package rpg.writer.scripts;

public final class ScriptWarning {
	public static enum Type {
		BAD_INPUT, NOT_IMPLEMENTED_YET, NOT_RECOGNIZED, NOT_VALID_THERE;
	}

	public static ScriptWarning inputBad(final int lineNumber, final String line, final String message)  {
		return new ScriptWarning(Type.BAD_INPUT, lineNumber, line, message);
	}
	
	public static ScriptWarning notImplemented(final int lineNumber,
			final String line, final String msg) {
		return new ScriptWarning(Type.NOT_IMPLEMENTED_YET, lineNumber, line,
				msg);
	}

	public static ScriptWarning notRecognized(final int lineNumber,
			final String line, final String message) {
		return new ScriptWarning(Type.NOT_RECOGNIZED, lineNumber, line, message);
	}

	public static ScriptWarning notValidThere(final int lineNumber,
			final String line, final String msg) {
		return new ScriptWarning(Type.NOT_VALID_THERE, lineNumber, line, msg);
	}

	private final Type type;

	private final int lineNumber;

	private final String line;

	private final String message;

	private ScriptWarning(final Type t, final int num, final String input,
			final String msg) {
		super();
		type = t;
		lineNumber = num;
		line = input;
		message = msg;
	}

	@Override
	public String toString() {
		return "Warning on line #" + lineNumber + " " + type + " " + message
				+ " from text: " + line;
	}
}
